package qingke.command.impl;

import java.util.ArrayList;

import qingke.app.OrderApp;
import qingke.app.OrderDao;
import qingke.command.UserCommand;
import qingke.pojo.Product;
import qingke.pojo.User;
import qingke.util.Console;

public class ProductCommand extends UserCommand {
	public ProductCommand (User user){
		super(user);
	}

	@Override
	public void execute() {
		OrderDao od = new OrderDao();
		ArrayList<Product> products = null;
		
		products = od.getProduct();
		user.setProducts(products);
		for(Product p : products){
			Console.println(p.toString1());
		}
		OrderApp.getInstance().setUser(user);
	}

}
